package org.example._04mybatis.mapper;



import org.apache.ibatis.annotations.*;
import org.example._04mybatis.pojo.Comment;
import org.example._04mybatis.pojo.CommentVO1;
import org.example._04mybatis.pojo.CommentVO2;

import java.util.List;

@Mapper
public interface CommentMapper {

//     @Insert("insert into blog.comment(content,created,weibo_id,user_id) " +
//             "values (#{content},#{created},#{weibo_id},#{user_id})")

     // 插入评论的接口
     int insertComment (Comment comment);



//     @Delete("delete from blog.comment where id=#{id}")

     // 删除评论的接口
     int deleteComment (Integer id);



//     @Update("update blog.comment " +
//             "set content=#{content},created=#{created},weibo_id=#{weibo_id},user_id=#{user_id} " +
//             "where id=#{id}")

     // 修改评论的接口
     int UpdateComment (Comment comment);



//     @Select("select content,user_id,weibo_id " +
//             "from blog.comment " +
//             "where id= #{id}")

     // 通过评论id查询评论的内容、用户id、微博id
     CommentVO1 selectCommentVO1ById (Integer id);


//     @Select("select content,user_id " +
//             "from blog.comment " +
//             "where weibo_id= #{weibo_id}")

     // 通过微博id查询评论的内容、用户id
     List<CommentVO2> selectCommentVO2ByWeiBoId (Integer weibo_id);
}
